package com.ewzj.bigdata.mvp.ui.adapter;

import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ewzj.bigdata.R;
import com.ewzj.bigdata.mvp.model.rspbean.SubFilterBean;

import java.util.List;

/**
 * author:zhangjing
 * 作用:
 * return:
 */

public class FilterTypeAdapter extends BaseQuickAdapter<SubFilterBean.DataEntity.ChildrenEntity,BaseViewHolder> {
    public FilterTypeAdapter(List<SubFilterBean.DataEntity.ChildrenEntity> data) {
        super(R.layout.item_filter_type, data);
    }
    @Override
    protected void convert(final BaseViewHolder baseViewHolder, final SubFilterBean.DataEntity.ChildrenEntity s) {
        ImageView ivcheck=baseViewHolder.getView(R.id.cb_check);
        ivcheck.setSelected(s.isseld());
        baseViewHolder.setText(R.id.tv_type,s.getName());
        baseViewHolder.getConvertView().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                s.setIsseld(!s.isseld());
                notifyItemChanged(baseViewHolder.getLayoutPosition());
            }
        });
    }
}
